const express = require('express');
const router = express.Router();

router.get('/', (req, res) => {
    const content = [];
    for(let i = 0; i < 40; i++) content.push({
        id: `${i + 1}`,
        vehicleFollowId: 'string',
        brandCode: 'string',
        saleConfirmationrCode: 'string',
        invoiceCode: 'string',
        invoiceDate: '2020-04-21T05:45:03.610Z',
        containerCode: 'string',
        containerDate: '2020-04-21T05:45:03.610Z',
        leadMark: 'string',
        frameCode: 'string',
        emptyContainerWeight: 1,
        threeVINWeight: 1,
        totalWeight: 1,
        bindingBands: 1,
        carriageWeight: 1,
        container: 'string',
        cheryCar: 'string',
        version: 'string',
        color: 'string',
        perGW: 1,
        glonassNO: 'string',
        engineNumber: 'string',
        displacement: 'string',
        hsCode: 'string',
        vin: 'string',
        productionYear: 'string',
        ottc: 'string',
        qty: 1,
        unitPriceExw: 1,
        insurance: 1,
        freight1: 1,
        freight2: 1,
        totalAmount: 1,
        vehicleDescribe: 'string',
        mileage: 1,
        manufactureDate: '2020-04-21T05:45:03.610Z',
        from: 'string',
        to: 1,
        deliveryTerms: 'string',
        consignee: 'string',
        buyer: 'string',
        frameTradeTerms: 'string',
        vehicleContractNo: 'string',
        vehicleContractDate: '2020-04-21T05:45:03.610Z',
        frameContractNo: 'string',
        contractDate: '2020-04-21T05:45:03.610Z',
        payment: 'string',
        operaterTime: '2020-04-21T05:45:03.610Z',
        operaterName: 'string',
        isPrint: true,
        options: [
            'update',
            'export'
        ],
    });
    res.json({
        message: '',
        payload: {
            content,
            totalElements: 40,
        }
    });
});
router.get('/:id/finally', (req, res) => {
    res.json(
        {
            message: 'string',
            payload: {
                dealerId: 'string',
                dealerCode: 'string',
                dealerName: 'string',
                brandId: 'string',
                brandCode: 'string',
                brandName: 'string',
                contactInfo: 'string',
                from: 'string',
                to: 1,
                deliveryTerms: 'string',
                consignee: 'string',
                buyer: 'string',
                frameTradeTerms: 'string',
                vehicleContractNo: 'string',
                vehicleContractDate: '2020-04-22T06:49:29.062Z',
                frameContractNo: 'string',
                contractDate: '2020-04-22T06:49:29.062Z',
                payment: 'string',
                tradeMethod: '1'
            }
        }
    );
});
router.get('/:id', (req, res) => {
    res.json(
        {
            message: 'string',
            payload: {
                id: '1',
                brandId: 'string',
                brandCode: 'string',
                brandName: 'string',
                dealerId: 'string',
                dealerCode: 'string',
                dealerName: 'string',
                contactInfo: 'string',
                saleConfirmationrCode: 'string',
                from: 'string',
                to: 1,
                deliveryTerms: 'string',
                consignee: 'string',
                buyer: 'string',
                frameTradeTerms: 'string',
                vehicleContractNo: 'string',
                vehicleContractDate: '2020-04-23T02:25:12.952Z',
                frameContractNo: 'string',
                contractDate: '2020-04-23T02:25:12.952Z',
                payment: 'string',
                tradeMethod: '1',
                detail: [
                    {
                        id: '1',
                        vehicleFollowId: 'string',
                        invoiceCode: 'string',
                        invoiceDate: '2020-04-23T02:25:12.952Z',
                        containerCode: 'string',
                        containerDate: '2020-04-23T02:25:12.952Z',
                        leadMark: 'string',
                        frameCode: 'string',
                        emptyContainerWeight: 1,
                        threeVINWeight: 1,
                        totalWeight: 1,
                        bindingBands: 1,
                        carriageWeight: 1,
                        container: 'string',
                        cheryCar: 'string',
                        version: 'string',
                        color: 'string',
                        perGW: 1,
                        glonassNO: 'string',
                        engineNumber: 'string',
                        displacement: 'string',
                        hsCode: 'string',
                        vin: 'string',
                        productionYear: 'string',
                        ottc: 'string',
                        qty: 1,
                        unitPriceExw: 1,
                        insurance: 1,
                        freight1: 1,
                        freight2: 1,
                        totalAmount: 1,
                        vehicleDescribe: 'string',
                        mileage: 1,
                        manufactureDate: '2020-04-23T02:25:12.952Z'
                    },
                    {
                        id: '2',
                        vehicleFollowId: 'string',
                        invoiceCode: 'string',
                        invoiceDate: '2020-04-23T02:25:12.952Z',
                        containerCode: 'string',
                        containerDate: '2020-04-23T02:25:12.952Z',
                        leadMark: 'string',
                        frameCode: 'string',
                        emptyContainerWeight: 1,
                        threeVINWeight: 1,
                        totalWeight: 1,
                        bindingBands: 1,
                        carriageWeight: 1,
                        container: 'string',
                        cheryCar: 'string',
                        version: 'string',
                        color: 'string',
                        perGW: 1,
                        glonassNO: 'string',
                        engineNumber: 'string',
                        displacement: 'string',
                        hsCode: 'string',
                        vin: 'string',
                        productionYear: 'string',
                        ottc: 'string',
                        qty: 1,
                        unitPriceExw: 1,
                        insurance: 1,
                        freight1: 1,
                        freight2: 1,
                        totalAmount: 1,
                        vehicleDescribe: 'string',
                        mileage: 1,
                        manufactureDate: '2020-04-23T02:25:12.952Z'
                    },
                    
                    {
                        id: '3',
                        vehicleFollowId: 'string',
                        invoiceCode: 'string',
                        invoiceDate: '2020-04-23T02:25:12.952Z',
                        containerCode: 'string',
                        containerDate: '2020-04-23T02:25:12.952Z',
                        leadMark: 'string',
                        frameCode: 'string',
                        emptyContainerWeight: 1,
                        threeVINWeight: 1,
                        totalWeight: 1,
                        bindingBands: 1,
                        carriageWeight: 1,
                        container: 'string',
                        cheryCar: 'string',
                        version: 'string',
                        color: 'string',
                        perGW: 1,
                        glonassNO: 'string',
                        engineNumber: 'string',
                        displacement: 'string',
                        hsCode: 'string',
                        vin: 'string',
                        productionYear: 'string',
                        ottc: 'string',
                        qty: 1,
                        unitPriceExw: 1,
                        insurance: 1,
                        freight1: 1,
                        freight2: 1,
                        totalAmount: 1,
                        vehicleDescribe: 'string',
                        mileage: 1,
                        manufactureDate: '2020-04-23T02:25:12.952Z'
                    }
                ],
                options: [
                    'abandon'
                ],
            }
        }
    );
});

router.get('/export', (req, res) => {
    res.json({
        message: '导出成功'
    });
});
module.exports = router;
